﻿Imports OpenTK.Graphics.OpenGL4

Module GLExtensions
    Public extensions As HashSet(Of String)

    Public Sub EnumerateExtensions(Optional bShow As Boolean = False)
        extensions = New HashSet(Of String)(GL.GetString(StringName.Extensions).Split(" "))
        If bShow Then
            Console.WriteLine("Extensions:")
            For Each e In extensions
                Console.WriteLine(e)
            Next
        End If
    End Sub

    Public Function DirectStateAccessSupported() As Boolean
        Return extensions.Contains("GL_ARB_direct_state_access")
    End Function

    Public Function BindlessTextureSupported() As Boolean
        Return extensions.Contains("GL_ARB_bindless_texture")
    End Function

    Public Function SparseTextureSupported() As Boolean
        Return extensions.Contains("GL_ARB_sparse_texture")
    End Function

    Public Function ShaderAtomicCounterOpsSupported() As Boolean
        Return extensions.Contains("GL_ARB_shader_atomic_counter_ops")
    End Function
End Module
